import axios from "../index.js";
// 知识库
// 分页查询
export const getListApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/listPage",
    method: "post",
    data: data
  });
};
// 导出
export const onExportApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/exportData",
    method: "post",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 保存
export const saveApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/save",
    method: "post",
    data: data
  });
};
// 编辑
export const editApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/updById",
    method: "post",
    data: data
  });
};
// 删除
export const delApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/deleteById",
    method: "get",
    data: data
  });
};
// 详情
export const getByIdApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/getById",
    method: "get",
    data: data
  });
};
// 知识库  预览下载次数统计
export const getStatisticsApi = (data) => {
  return axios.request({
    url: "/plan_training/repository/downloadStatistic",
    method: "get",
    data: data
  });
};
